This page has been superceded by a wiki version of this example: EscapeSequencesExample







/*



File:    escape.d

Author:  J C Calvarese

Website: http://jcc_7.tripod.com/d/

License: Public Domain



Purpose: 

Demonstrates how to use escaping to put backslashes and apostrophes 

for a literal character.



*/



const char[] backslashWYSIWYG = `\`;

const char[] quoteWYSIWYG = `'`;

const char[] doubleQuoteWYSIWYG = `"`;



const char[] doubleQuoteReg = "\"";

const char[] quoteReg = "\'";

const char[] backslahReg = "\\";





const char quoteChar = '\'';



const char backslashChar = '\\';

















void main()

{

    printf(cast(char[]) (doubleQuoteReg ~ "That's what I said!" ~ doubleQuoteReg ~ \n\0));  

}